import request from '@/utils/request'

export function listGoods(query) {
  return request({
    url: 'manager/product',
    method: 'get',
    params: { 'page': query.page - 1, 'size': query.size, 'sort': query.sort, 'name': query.name }
  })
}

export function createGoods(data) {
  return request({
    url: '/goods/create',
    method: 'post',
    data
  })
}

export function readGoods(data) {
  return request({
    url: '/goods/read',
    method: 'get',
    data
  })
}

export function updateGoods(data) {
  return request({
    url: '/goods/update',
    method: 'post',
    data
  })
}

export function deleteGoods(data) {
  return request({
    url: '/goods/delete',
    method: 'post',
    data
  })
}
